package com.wzy.peopleManagement.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	import com.wzy.peopleManagement.vo.UserInfoVO;
	
	import mx.rpc.IResponder;
	import mx.rpc.remoting.RemoteObject;
	
	public class UserDeledate
	{
		public var responder     : IResponder;
		public var remoteService : RemoteObject;
		
		private var result : Object;
		public function UserDeledate(_responder : IResponder)
		{
			this.responder = _responder;
			remoteService = ServiceLocator.getInstance().getRemoteObject("userDataService");
		}
		/**
		 * 登陆验证
		 */ 
		public function checkLogin(vo : UserInfoVO) : void {
			result = remoteService.checkLogin(vo);
			result.addResponder(responder);
		}
		/**
		 * 添加用户
		 */ 
		public function addUser(vo : UserInfoVO) : void {
			result = remoteService.saveUser(vo);
			result.addResponder(responder);
		}
		/**
		 * load所有的用户
		 */ 
		public function loadAllUser() : void {
			result = remoteService.findAllUser();
			result.addResponder(responder);
		}
		/**
		 * 根据ID加载用户信息
		 */ 
		public function loadUserById(userId : String) : void {
			result = remoteService.findUserById(userId);
			result.addResponder(responder);
		}
		/**
		 * 根据ID删除用户信息
		 */  
		public function deleteUserById(userId : String) : void {
			result = remoteService.deleteUserById(userId);
			result.addResponder(responder);
		}
	}
}